package com.lilicould.dao;

import com.lilicould.entity.ClassDetails;
import com.lilicould.entity.Classes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ClassDao {

    @Select("select * from class_details_view order by college_code,major_code,class_code")
    ClassDetails[] getAllClass();

    @Insert("insert into classes values (#{classCode},#{className},#{majorCode},#{collegeCode},#{enrollmentYear})")
    int addClass(Classes clazz);

    @Delete("delete from classes where class_code=#{classCode} and major_code=#{majorCode} and college_code=#{collegeCode}")
    int deleteClass(@Param("classCode") String classCode, @Param("majorCode") String majorCode, @Param("collegeCode") String collegeCode);

}
